import request from "@/utils/request.js";

const api_prefix = "/business";

export function searchStoreData(pageNo, pageSize, storeId, msg) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/search/store/front/${pageNo}/${pageSize}/${storeId}/${msg}`,
    method: "GET",
  });
}

export function list(userId) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/front/list/${userId}`,
    method: "GET",
  });
}

export function getStores(pageNo, pageSize, storeId) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/front/info/list/${pageNo}/${pageSize}/${storeId}`,
    method: "GET",
  });
}

export function findPerimeterStores(pageNo, pageSize) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/perimeter/list/${pageNo}/${pageSize}`,
    method: "GET",
  });
}

export function searchGoods(storeId) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/shop/recommend/list/${storeId}`,
    method: "GET",
  });
}

export function saveBusiness(data) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/save`,
    method: "POST",
    data: data,
  });
}

export function echo(id) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/getById/${id}`,
    method: "GET",
  });
}

export function update(data) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/update`,
    method: "PUT",
    data: data,
  });
}

export function removeBatchByKeys(keys) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/remove/${keys}`,
    method: "DELETE",
  });
}
